#ifndef LRCPAGE_H
#define LRCPAGE_H

#include <QWidget>
#include<QPropertyAnimation>
//LRC行歌词结构
struct LrcWordLine
{
    LrcWordLine(qint64 lrctime,QString lrctext)
    {
        this->LrcText=lrctext;
        this->LrcTime=lrctime;
    }
    qint64 LrcTime;
    QString LrcText;
};
namespace Ui {
class lrcpage;
}

class lrcpage : public QWidget
{
    Q_OBJECT

public:
    explicit lrcpage(QWidget *parent = nullptr);
    ~lrcpage();

    bool praseFilePath(const QString& LrcFilePath,const QString LrcMusicName,const QString LrcMusicSinger);
    void showLrcWordLine(qint64 time);//同步歌词显示
    int getLrcWordLineIndex(qint64 time);//根据歌词时间获取歌词索引
    QString getLrcWord(int index);//根据索引获取歌词
    void setLrcTitle(const QString musicName,const QString musicSinger);

private:
    Ui::lrcpage *ui;
    QPropertyAnimation*lrcpageAnimation;
    QVector<LrcWordLine> LrcWordLines;
};

#endif // LRCPAGE_H
